import {emit} from "@tauri-apps/api/event";
import {storeToRefs} from "pinia";
import {useUserStore} from "../stores/user.ts";

export  function sendVideoMessage(cmd: string,content: any="call message") {
    let {toUserAccount, userInfo} = storeToRefs(useUserStore());
    emit("send-message", {
        sender_account: userInfo.value.account,
        to_account: toUserAccount.value,
        message_type: {
            cmd: cmd,
            method: "all",
        },
        content: content,
    }).then(() => {
        console.log("send-message-video-"+cmd+" successfully");
    });
}